package cn.hellochaos.generator.service;

import cn.hellochaos.generator.entity.CaipuList;
import cn.hellochaos.generator.entity.FenleiCaipu;
import cn.hellochaos.generator.entity.dto.CaipuDetailDto;
import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;

import java.util.List;

/**
* <p>
* 主表：菜谱列表 服务类
* </p>
*
* @author test
* @since 2021-01-23
*/
public interface CaipuListService {

    CaipuDetailDto getCaipuDetailById(Integer caipuBookId);

    List<CaipuList> findNewList7();

    /*===============================================*/
    /**
    * 分页查询CaipuList
    *
    * @param page     当前页数
    * @param pageSize 页的大小
    * @param factor  搜索关键词
    * @return 返回mybatis-plus的Page对象,其中records字段为符合条件的查询结果
    * @author test
    * @since 2021-01-23
    */
    Page<CaipuList> listCaipuListsByPage(int page, int pageSize, String factor);

    /**
    * 根据id查询CaipuList
    *
    * @param id 需要查询的CaipuList的id
    * @return 返回对应id的CaipuList对象
    * @author test
    * @since 2021-01-23
    */
    CaipuList getCaipuListById(int id);

    /**
    * 插入CaipuList
    *
    * @param caipuList 需要插入的CaipuList对象
    * @return 返回插入成功之后CaipuList对象的id
    * @author test
    * @since 2021-01-23
    */
    int insertCaipuList(CaipuList caipuList);

    /**
    * 根据id删除CaipuList
    *
    * @param id 需要删除的CaipuList对象的id
    * @return 返回被删除的CaipuList对象的id
    * @author test
    * @since 2021-01-23
    */
    int deleteCaipuListById(int id);

    /**
    * 根据id更新CaipuList
    *
    * @param caipuList 需要更新的CaipuList对象
    * @return 返回被更新的CaipuList对象的id
    * @author test
    * @since 2021-01-23
    */
    int updateCaipuList(CaipuList caipuList);


    List<CaipuList> getCookbookByCookBookName(String cookbookName);

}
